package com.example.springdemo2.config;

import com.example.springdemo2.beans.Identity;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * @author 27013
 **/

@Configuration
@ComponentScan(basePackages = {"com.example.springdemo2"})
public class ApplicationContextConfig {
    @Bean(name= "identity",initMethod="initMethod",destroyMethod = "destroyMethod")
    @Scope("singleton")
    public Identity getIdentity(){
    return new Identity();
    }
}
